class Person {
  // 构造函数就是实例化中触发的方法
  name: string;
  constructor(name: string) {
    this.name = name;
  };
  run(): void {
    console.log(this.name);
  };
  getName(): string {
    return this.name;
  };
  setName(name: string): void {
    this.name = name;
  };
};
let san = new Person("好人的");
san.run();

// ts中实现继承，extends\super
class Person1 {
  name: string;
  constructor(name: string) {
    this.name = name;
  };
  run(): string {
    return `我是${this.name}在运动`;
  };
};
let son1 = new Person("成");
son1.run();

class web extends Person1 {
  name: string;
  constructor(name: string) {
    super(name);
    this.name = name;
  };
};